package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * EmploymentRecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Employment_Record", schema = "dbo", catalog = "StudentManager")
public class EmploymentRecord implements java.io.Serializable {

	// Fields

	private Long employmentRecordId;
	private GraduateInfo graduateInfo;
	private String company;
	private String pastPosition;
	private String leaveReason;
	private Timestamp assumeOfficeDate;
	private Timestamp leaveDate;

	// Constructors

	/** default constructor */
	public EmploymentRecord() {
	}

	/** minimal constructor */
	public EmploymentRecord(Long employmentRecordId, String company,
			String pastPosition) {
		this.employmentRecordId = employmentRecordId;
		this.company = company;
		this.pastPosition = pastPosition;
	}

	/** full constructor */
	public EmploymentRecord(Long employmentRecordId, GraduateInfo graduateInfo,
			String company, String pastPosition, String leaveReason,
			Timestamp assumeOfficeDate, Timestamp leaveDate) {
		this.employmentRecordId = employmentRecordId;
		this.graduateInfo = graduateInfo;
		this.company = company;
		this.pastPosition = pastPosition;
		this.leaveReason = leaveReason;
		this.assumeOfficeDate = assumeOfficeDate;
		this.leaveDate = leaveDate;
	}

	// Property accessors
	@Id
	@Column(name = "Employment_Record_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getEmploymentRecordId() {
		return this.employmentRecordId;
	}

	public void setEmploymentRecordId(Long employmentRecordId) {
		this.employmentRecordId = employmentRecordId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Graduate_id")
	public GraduateInfo getGraduateInfo() {
		return this.graduateInfo;
	}

	public void setGraduateInfo(GraduateInfo graduateInfo) {
		this.graduateInfo = graduateInfo;
	}

	@Column(name = "Company", nullable = false, length = 50)
	public String getCompany() {
		return this.company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	@Column(name = "Past_Position", nullable = false, length = 20)
	public String getPastPosition() {
		return this.pastPosition;
	}

	public void setPastPosition(String pastPosition) {
		this.pastPosition = pastPosition;
	}

	@Column(name = "Leave_Reason")
	public String getLeaveReason() {
		return this.leaveReason;
	}

	public void setLeaveReason(String leaveReason) {
		this.leaveReason = leaveReason;
	}

	@Column(name = "Assume_Office_Date", length = 23)
	public Timestamp getAssumeOfficeDate() {
		return this.assumeOfficeDate;
	}

	public void setAssumeOfficeDate(Timestamp assumeOfficeDate) {
		this.assumeOfficeDate = assumeOfficeDate;
	}

	@Column(name = "Leave_Date", length = 23)
	public Timestamp getLeaveDate() {
		return this.leaveDate;
	}

	public void setLeaveDate(Timestamp leaveDate) {
		this.leaveDate = leaveDate;
	}

}